<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<title>${name_china}管理列表</title>
<%@include file="/common/head.jsp" %>

<!-- 时间日期插件 -->
<link href="<%=request.getContextPath()%>/static/plugin/My97DatePicker/skin/default/datepicker.css" rel="stylesheet" >
<script src="<%=request.getContextPath()%>/static/plugin/My97DatePicker/WdatePicker.js"></script>
<style>
	.deliertitle{
		font-size:16px;
		color:#323232;
	}
	html,body{background:#eff3f6;}
	/***订单来源**/
	.orderoot{padding:10px 0px;overflow:auto;zoom:1}
	.ordernum{width:49.7%;float:left;background:#fff;padding: 12px 0px;height: 206px;}
	.orderlogist{width:49.5%;float:left;margin-left:8px;padding: 12px 0px;background:#fff;}
	.sameorder{line-height: 24px;display: block;padding: 3px 16px;}
	.addnotes{margin-left: 10px;color: #1f95ef;text-decoration: underline;cursor: pointer;}
	.delaybut{width:120px;height:36px;background:#8191a6;text-align:center;line-height:36px;color:#fff;margin:0 auto;}
	/****物流****/
	.orderlogtitle{padding:3px 16px;}
	.toolfont{padding:3px 16px;color:#ff2040;}
	.goodorder{padding:3px 16px;}
	.samegoodcode{}
	.selcheckbox{position: relative;top: 3px;margin-right: 10px;}
	.samefiled{padding:3px 16px;}
	.confirmbut{width:100px;height:36px;line-height:36px;text-align:center;color:#fff;background:#1f95ef;margin-left:174px;margin-top: 10px;}
	/****信息地址消息****/
	.inforlist{padding:16px;background:#fff;}
	.inforlist-ul{width:100%;overflow:auto;zoom:1;}
	.sameinfor-li{width:25%;float:left;background:#fff;}
	.sameinfotitle{line-height: 20px;}
	.sametext{line-height:22px;display:block;}
	.revisebut{color: #ff2040;text-decoration: underline;margin-left: 35px;cursor:pointer;}
	.checkbut{color: #1f95ef;text-decoration: underline;margin-left: 156px;cursor:pointer;}
	.remarkcon{width:80%;height:90px;border: solid 1px #ccc;margin-top: 11px;}
	/*****商品视图******/
	.goodview{padding:16px;background:#fff;margin-top:25px;}
	.summer-datagrid-cell>img{width:100px;height:100px;}
	.termcon{margin-top:40px;}
	.sameterm{line-height:20px;display:block;text-align: right;}
	.samenum{margin-left:12px;}
	.allprice{color:#ff2040;font-size:18px;}
	/******物流*******/
	.samelogist{width:49%;display:inline-block;}
	.sameorderlabel{display: inline-table;margin-top: 6px;}
	.sameorderlabel>span{display: block;padding-left: 16px;}
	.pitchlabel{color:#ff2040;}
	.morebut{line-height: 26px;text-align: center;width: 84px;height: 26px;margin: 0 auto;margin-top: 15px;color: #1f95ef;cursor:pointer;}
	/******蒙版*******/
	.maskcon{width:100%;height:100%;position:fixed;top:0;left:0;background-color: rgb(0, 0, 0);opacity:0.3;z-index:123}
	.maskMain{width:400px;padding-bottom: 24px;background:#fff;position: fixed;z-index:1234;top: 184px;left: 495px;border-radius: 15px;}
	.headcon{width:100%;height:34px;background:#f5f5f5;border-radius: 15px 15px 0px 0px;}
	.masktitle{line-height: 34px;margin-left: 13px;display: inline-block;}
	.closebut{width:20px;height:20px;background:#f5362e;color:#fff;border-radius:20px;float:right;display:inline-block;line-height:20px;text-align:center;vertical-align: middle;margin-top: 5px;margin-right: 8px;cursor: pointer;}
	.primartcon{padding:15px;}
	.sameparm{line-height: 24px;padding-left: 50px;margin-top: 4px;}
	.radiosty{margin-top:4px;margin-right:9px;}
	.otherteaxt{border: solid 1px #ccc;width: 80%;height: 66px;}
	.samebut{width:84px;height:31px;display:inline-block;line-height:31px;text-align:center;color:#fff;font-size:14px;cursor:pointer;}
	.samebut:nth-child(1){background:#1f95ef;}
	.samebut:nth-child(2){background:#8192a6;margin-left:21px;}
	.spotcon{margin-left:89px;display:inline-flex;}
	.vesiontext{border:solid 1px #ccc;height: 21px;}
</style>
</head>
<body class="iframe-page">
<div class="page-title-wrapper">
    <div class="page-title">
        <div class="page-title-text">
            <span>${name_china}管理</span>
        </div>
        <div id="toolbar" style="float: right"></div>
    </div>
    <div class="page-title-border"></div>
</div>
<h1 class="deliertitle">待发货详情页</h1>
<!-- -发货内容- -->
<div class="orderoot">
	<div class="ordernum">
		<span class="sameorder">订单号：0000000</span>
		<span class="sameorder">订单状态：待发货</span>
		<span class="sameorder">订单来源：app</span>
		<span class="sameorder">备注：无<a class="addnotes">添加备注</a></span>
		
	</div>
	<div class="orderlogist">
		<!-- <h4 class="orderlogtitle">物流</h4> -->
		<div class="samelogist">
			<h4 class="orderlogtitle">物流:<span>商品编号18200000</span></h4>
			<label class="sameorderlabel pitchlabel">
				<span>2018-01-03 10:05</span>
				<span>您的订单正在派件，运单号100000【大脸猫办公专卖店】</span>
			</label>
			<label class="sameorderlabel">
				<span>2018-01-03 10:05</span>
				<span>您的订单正在派件，运单号100000【大脸猫办公专卖店】</span>
			</label>
			<label class="sameorderlabel">
				<span>2018-01-03 10:05</span>
				<span>您的订单正在派件，运单号100000【大脸猫办公专卖店】</span>
			</label>
			<label class="sameorderlabel">
				<span>2018-01-03 10:05</span>
				<span>您的订单正在派件，运单号100000【大脸猫办公专卖店】</span>
			</label>
		</div>
		<div class="samelogist">
			<h4 class="orderlogtitle">物流:<span>商品编号18200000</span></h4>
			<label class="sameorderlabel pitchlabel">
				<span>2018-01-03 10:05</span>
				<span>您的订单正在派件，运单号100000【大脸猫办公专卖店】</span>
			</label>
			<label class="sameorderlabel">
				<span>2018-01-03 10:05</span>
				<span>您的订单正在派件，运单号100000【大脸猫办公专卖店】</span>
			</label>
			<label class="sameorderlabel">
				<span>2018-01-03 10:05</span>
				<span>您的订单正在派件，运单号100000【大脸猫办公专卖店】</span>
			</label>
			<label class="sameorderlabel">
				<span>2018-01-03 10:05</span>
				<span>您的订单正在派件，运单号100000【大脸猫办公专卖店】</span>
			</label>
		</div>
		<div class="morebut">查看更多</div>
	</div>
</div>

<!-- -个人信息- -->
<div class="inforlist">
	<ul class="inforlist-ul">
		<li class="sameinfor-li">
			<h4 class="sameinfotitle">收货人信息</h4>
			<span class="sametext">联系买家:大脸猫</span>
			<span class="sametext">收货人:大脸猫</span>
			<span class="sametext">地址:天津市武清开发区创业基本B11-5</span>
			<span class="sametext">手机号：17602228784 <a class="revisebut">修改</a></span>
			<a class="checkbut">点击查看</a>
			<textarea class="remarkcon"></textarea>
		</li>
		<li class="sameinfor-li">
			<h4 class="sameinfotitle">配送信息</h4>
			<span class="sametext">送货方式:无</span>
			<span class="sametext">物流公司名称:大脸猫</span>
			<span class="sametext">运单号:大脸猫</span>
			<span class="sametext">运费:大脸猫</span>
			<span class="sametext">客服电话:大脸猫</span>
		</li>
		<li class="sameinfor-li">
			<h4 class="sameinfotitle">付款信息</h4>
			<span class="sametext">付款方式：支付宝</span>
			<span class="sametext">付款时间:大脸猫</span>
			<span class="sametext">成交时间:大脸猫</span>
			<span class="sametext">确认时间:大脸猫</span>
			<span class="sametext">商品总额:大脸猫</span>
			<span class="sametext">运费金额:大脸猫</span>
			<span class="sametext">红包优惠:大脸猫</span>
			<span class="sametext">优惠券:大脸猫</span>
			<span class="sametext">惠金币:大脸猫</span>
		</li>
		<li class="sameinfor-li">
			
			<span class="sametext">余额：支付宝</span>
			<span class="sametext">实际金额:大脸猫</span>
			
		</li>
	</ul>
</div>

<!-- -商品- -->
<div class="goodview">
	<div class="summer-datagrid-wrap" style="width: 100%;">
		<div class="summer-datagrid-head" style="width: 100%;">
			<div class="summer-datagrid-head-inner">
				<table class="summer-datagrid" id="" style="width: 1393px;">
				    <thead>
					    <tr>
					         <th><div class="summer-datagrid-cell">商品视图</div></th>
					        <th><div class="summer-datagrid-cell">商品名称/编号</div></th>
					        <th><div class="summer-datagrid-cell">商品属性</div></th>
							<th><div class="summer-datagrid-cell">状态</div></th>
							<th><div class="summer-datagrid-cell">商品单价</div></th>
							<th><div class="summer-datagrid-cell">商品数量</div></th>
							<th><div class="summer-datagrid-cell">佣金比例/佣金</div></th>
							<th><div class="summer-datagrid-cell">库存状态</div></th>
							<th><div class="summer-datagrid-cell">商品总价</div></th>
					    </tr>
				    </thead>
    			</table>
    		</div>
    	</div>
    	<div class="summer-datagrid-body" style="width: 100%;">
    			<div class="summer-datagrid-body-inner">
    				<table class="summer-datagrid" id="" >
   						 <tbody>
   						 	<tr>
   						 		<td><div class="summer-datagrid-cell"><img src="http://file.jhjvip.cn/images/e445e29b-2fde-4efc-bdb7-60daa00462a9.jpg"></div></td>
   						 		<td><div class="summer-datagrid-cell">商品编号：100000<br/>新的商品</div></td>
   						 		<td><div class="summer-datagrid-cell">主要颜色：白色<br/>尺码：L</div></td>
   						 		<td><div class="summer-datagrid-cell">状态：已取消</div></td>
   						 		<td><div class="summer-datagrid-cell">168.00</div></td>
   						 		<td><div class="summer-datagrid-cell">56</div></td>
   						 		<td><div class="summer-datagrid-cell">佣金比率：20%<br/>佣金：200</div></td>
   						 		<td><div class="summer-datagrid-cell">30</div></td>
   						 		<td><div class="summer-datagrid-cell">99</div></td>
   						 	</tr>
   						 </tbody>
   				   </table>
   				</div>
   		</div>
	</div>	
	<!-- -商品价钱- -->
	<div class="termcon">
		<div class="sameterm">商品总价：<span class="samenum">￥299</span></div>
		<div class="sameterm">运费：<span class="samenum">￥299</span></div>
		<div class="sameterm">红包优惠：<span class="samenum">￥299</span></div>
		<div class="sameterm">优惠券：<span class="samenum">￥299</span></div>
		<div class="sameterm">减钱：<span class="samenum">￥299</span></div>
		<div class="sameterm">惠金币：<span class="samenum">￥299</span></div>
		<div class="sameterm">商品总价：<span class="allprice">￥299</span></div>
	</div>
</div>
 <div class="maskcon"></div>
 <div class="maskMain">
 	<div class="headcon">
 		<h4 class="masktitle">关闭理由</h4>
 		<div class="closebut">X</div>
 	</div>
 	<div class="primartcon">
 		<div class="sameparm"><input type="radio" class="radiosty">恶意下单</div>
 		<div class="sameparm"><input type="radio" class="radiosty">恶意下单</div>
 		<div class="sameparm">收货人姓名：<input type="text" class="vesiontext"></div>
 		<div class="sameparm"><textarea class="otherteaxt"></textarea></div>
 	</div>
 	<div class="spotcon">
 		<div class="samebut" id="surebut">确认</div>
 		<div class="samebut" id="cancelbut">取消</div>
 	</div>
 </div>
<script>
	//请求url
	var CONST_URL = {
		LIST: basePath + '${common_url}list',
	   	INIT_ADD: basePath + "${common_url}initAdd",
	   	INIT_EDIT: basePath + "${common_url}initEdit",
	   	INIT_VIEW: basePath + "${common_url}initView",
	   	DEL: basePath + "${common_url}delete",
	   	EXP: basePath + "${common_url}exp",
	   	INIT_SEND_EXPRESS: basePath + "${common_url}initSendExpress",
	   	INIT_IMP: basePath + "${common_url}initImp"
	};
	
    var  permission = CommonUtil.getPermission('${name_english}');
    
    $(function () {
    	
    	//关闭按钮
    	$(".closebut").on('click',function(){
    		$(".maskcon").hide();
    		$(".maskMain").hide();
    	})
    	//取消按钮事件
    	$("#cancelbut").on('click',function(){
    		$(".maskcon").hide();
    		$(".maskMain").hide();
    	})
    	
    /* 	function cat(name,ss){
    		this.name = name;
    		this.ss = ss;
    		this.type="sssss"
    		this.eat = function(){
    			alert("啊啊！")
    		}
    	}
    	var cat1 = new cat("测试","哈哈");
    	cat.prototype.ceshi = "ceshi";
    	var cat2 = new cat("对对","dd")
    	alert(cat1.ceshi);
    	alert(cat2.name); */
    	
    	
    	$('#status').combobox({
            valueField : 'code',
            textField : 'name',
            url : COMMON_URL.getCode + '?type=T_MALL_ORDER-STATUS'
        });
     	
        // 新建toobar
		$.funcbar({
			id: 'toolbar',
			type: 'toolbar',
			data: permission,
			permit: ['${name_english}:exp']
		});
        
        // 查询按钮
        $('#search').on('click', reloadTable);
        
        //重置按钮
        $('#reset').on('click', function () {
        	//重置文本框的值
        	$('#status').combobox('clear');
        	$('#orderNum').val('');
        	//$('#startTime').val(''); 
        	
        	//$('#stopTime').val('');
        	
        	reloadTable();
        });
        
        //新建
        $('#toolbar').on('click', 'a[data-permit="${name_english}:initAdd"]', function() {
        	window.location.href = CONST_URL.INIT_ADD; 	  	
		});
        
        
       createTable();
        
        //查看
        $('#t-wrap').on('click', 'a[data-permit="${name_english}:initView"]', function() {
        	var $this = $(this),
        	    id = $this.closest('tr').find('td[data-field="id"]').attr('data-value');
        	window.location.href = CONST_URL.INIT_VIEW +"?id=" + id;
        });
       
        //编辑
        $('#t-wrap').on('click', 'a[data-permit="${name_english}:initEdit"]', function() {
            var $this = $(this),
                id = $this.closest('tr').find('td[data-field="id"]').attr('data-value');
            window.location.href = CONST_URL.INIT_EDIT + '?id=' + id;
        });	
        
        //删除
		$('#t-wrap').on('click', 'a[data-permit="${name_english}:delete"]', function() {
			var $this = $(this),
			    id = $this.closest('tr').find('td[data-field="id"]').attr('data-value');
			$.sdialog({
				type: 'confirm',
				msg: '您确定要删除选中的记录吗?',
				onConfirm: function(result) {
				    if (result) {
				    	$.sajax({
			                url : CONST_URL.DEL + "?ids=" + id,
			                onLoadSuccess : function() {
			                	 $.stip({
                	                type:'ok',//显示类型 有info、 ok、 danger
                	                text: '删除成功！'    
			                	});
			                	reloadTable();  
			                }
			            });
				    		
				    }	
				}
			});
		});
        
        
		//发货
		$('#t-wrap').on('click', 'a[data-permit="${name_english}:initSendExpress"]', function() {
			  var $this = $(this),
              id = $this.closest('tr').find('td[data-field="id"]').attr('data-value');
              window.location.href = CONST_URL.INIT_SEND_EXPRESS + '?id=' + id;
		});
		
		 //导出 
        $('#toolbar').on('click', 'a[data-permit="${name_english}:exp"]', function() {
        	exp(); 	  	
		});
        
        
    });
    
    // 重新加载表格
	function reloadTable() {
		$('#dataList').datagrid('reload',{
            ajax: {
            	param: {
            		"status": trimSpace($('#status').combobox('getValue')),
            		"orderNum":  trimSpace($('#orderNum').val())
            	}
            }
        });
	}
    //关闭子窗口
	function closeWindow(object, isReload) 
    {
        object.close();
        isReload===true  && window.location.reload();
    }
    //创建表格
    function createTable() {
    	$('#dataList').datagrid({
    		ajax: {
    			url: CONST_URL.LIST,
    			param: {
    				"status": trimSpace($('#status').combobox('getValue')),
            		"orderNum":  trimSpace($('#orderNum').val())
            	}
    		},
    		columns: [
    		     {
    		    	 field: 'id',
    		    	 hidden: true
    		     },
    		     {
    		    	 field: 'userId',
    		    	 render: function (rowData) {
    		    		 return '<a href="javascript:;" data-permit="${name_english}:initView" class="link">'+ rowData.userId +'</a>';
    		    	 }
    		     },
    		     {
    		    	 field: 'orderNum'
    		     },
    		     {
    		    	 field: 'totalMoney'
    		     },
    		     {
    		    	 field: 'totalProduct'
    		     },
    		     {
    		    	 field: 'note'
    		     },
    		    {
    		    	 render: function (rowData) {
    		    		 if( rowData.status == "0" ){
    		    			 return "待支付";
    		    		 }
    		    		 if( rowData.status == "1" ){
    		    			 return $.funcbar({
        		    			 data: permission,    //请求的数据
        		    			 type: 'text',     //类型
        		    			 display: 3,    //显示数量
        		    			 permit: ['${name_english}:initEdit', '${name_english}:del','${name_english}:initSendExpress'] //需要的权限按钮
        		    		 });
    		    		 }
    		    		 if( rowData.status == "2" ){
    		    			 return "已发货";
    		    		 }
    		    		 if( rowData.status == "3" ){
    		    			 return "交易成功";
    		    		 }
    		    		 if( rowData.status == "4" ){
    		    			 return "退换货";
    		    		 }
    		    	 }
    		    }
    		          
    	    ]
    	});
    }
   
    
    //导出方法
    function exp() {
        //得到查询条件中的value和创建表单
        
        var orderNum = trimSpace($('#orderNo').val()),
            status = $('#state').combobox('getValue');
    	    //startTime = trimSpace($('#startTime').val()),
    	    //stopTime = trimSpace($('#stopTime').val());
        
        var form = document.createElement('form');//创建表单
        form.method = 'post';//表单提交方式
        form.action = CONST_URL.EXP;//路径
        document.body.appendChild(form);

        //创建查询条件(input隐藏)
        //全称
        if ( orderNum ) {
            var inputOrderNum = document.createElement('input');
            inputOrderNum.type = 'hidden';
            inputOrderNum.value = orderNum;
            inputOrderNum.name = 'orderNum';
            form.appendChild(inputName );
        }
        
        if ( status ) {
            var inputStatus = document.createElement('input');
            inputStatus.type = 'hidden';
            inputStatus.value = status;
            inputStatus.name = 'status';
            form.appendChild(inputStatus);
        }
        		       
        //如果没有任何条件就提示用户
        if ( orderNum || status  ) {
            form.submit();
        } else {
            $.sdialog({
                 type : 'confirm',
                 msg : '未添加导出条件，默认为全部导出，确定吗？',
                 onConfirm : function(result) {
                     if (result) {
                         form.submit();
                     }
                 }
             });
        }
    }
   
</script>
</body>
</html>